<?php

namespace App\Http\Resources;

use App\Models\Market;
use App\Models\MarketMemberLevel;
use App\Models\MyAddress;
use App\Models\PointsLog;
use App\Models\ProductOrder;
use App\Models\ProductOrdersLog;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Http\Resources\Json\JsonResource;

/**
 * Class ExhibitorInformation
 *
 * @property int $id
 * @property int $type_id
 * @property string|null $username
 * @property string|null $name
 * @property string|null $phone
 * @property string|null $password
 * @property string|null $address
 * @property string|null $remark
 * @property int $status
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 * @property string|null $cn_name
 * @property string|null $en_name_full
 * @property string|null $en_name
 * @property string|null $pwd
 * @property string|null $appellation
 * @property string|null $wx
 * @property string|null $telephone
 * @property string|null $e_mail
 * @property string|null $post_code
 * @property string|null $sales
 * @property int|null $customer_type
 * @property string|null $booth_number
 * @property int|null $booth_type
 * @property int|null $long
 * @property int|null $wide
 * @property int|null $area
 * @property string|null $discount
 * @property int|null $booth_fee
 * @property int|null $sponsorship_fees
 * @property int|null $signing_status
 * @property Carbon|null $signing_date
 * @property int|null $contract
 * @property int|null $unit_id
 * @property string|null $contacts
 * @property int|null $papers
 * @property string|null $files
 * @property int|null $collection_status
 * @property Carbon|null $collection_time
 * @property int|null $invoicing_status
 * @property Carbon|null $invoicing_time
 * @property int|null $is_invoicing
 *
 * @package App\Models
 */
class ExhibitorInformationResource extends JsonResource
{

    public function toArray($request)
    {

        $token = '';
        if (is_string($this->new_token)) {
            $token = $this->new_token;
        }
        return [
            'exhibitor_information_id' => $this->id,
            'name' => $this->name,
            'contacts' => $this->contacts,
            'is_update_pwd' => $this->is_update_pwd,
            'created_at' => optional($this->created_at)->getTimestamp(),
            'updated_at' => optional($this->updated_at)->getTimestamp(),
            'token' => $token,
        ];
    }
}
